Assignment #123 Simple File Input
Code
///Name: Ian Grant
///Period:5
///Project Name: Simple File Input
///File Name:name.java
///06/08/16
import java.io.File;
import java.util.Scanner;
public class name {
public static void main (String[] args) throws Exception {
String name="";
Scanner fileIn = new Scanner(new File("name.txt"));
name = fileIn.next();
fileIn.close();
System.out.println("Using my magical brain powers, not aided by anything at all, I have determined that your name is,"+name);
}
}
Output